package com.ccrfid.rmc6.lbservice3.mq;

public class MqTagPosition {
    private String tag;
    private Double x;
    private Double y;
    private Double pa;   //positionAccuracy: 位置准确度
    private Integer f;
    private Long t;

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public Double getX() {
        return x;
    }

    public void setX(Double x) {
        this.x = x;
    }

    public Double getY() {
        return y;
    }

    public void setY(Double y) {
        this.y = y;
    }

    public Double getPa() {
        return pa;
    }

    public void setPa(Double pa) {
        this.pa = pa;
    }

    public Integer getF() {
        return f;
    }

    public void setF(Integer f) {
        this.f = f;
    }

    public Long getT() {
        return t;
    }

    public void setT(Long t) {
        this.t = t;
    }

    //计算两个点之间的距离
    public double distance(MqTagPosition position) {
        if (this.f != position.getF()) {
            return 9999;
        } else {
            return Math.sqrt((this.x - position.getX()) * (this.x - position.getX())
                    + (this.y - position.getY()) * (this.y - position.getY()));
        }
    }

    @Override
    public String toString() {
        return "MqTagPosition{" +
                "tag='" + tag + '\'' +
                ", x=" + x +
                ", y=" + y +
                ", pa=" + pa +
                ", f=" + f +
                ", t=" + t +
                '}';
    }
}
